package com.zsw.gen;

import com.zsw.vo.ResultVO;

/**
 * 统一服务返回数据生成
 * @author zhangsw
 */
public class ResultUtil {
    public static ResultVO success(String msg, Object object) {
        ResultVO result = new ResultVO();
        result.setCode(200);
        result.setMsg(msg);
        result.setData(object);
        return result;
    }

    public static ResultVO success(String msg) {
        return success(msg, null);
    }

    public static ResultVO fail(String msg,Integer code){
        ResultVO result = new ResultVO();
        result.setCode(code);
        result.setMsg(msg);
        return result;
    }
}
